 <!-- 共用头部1 -->
  <link rel="stylesheet" href="../Public/style/catering_strategy.css" />
	 <div id="top">
		 <div class="head2 clear">
			 <div class="account sprite_icon">
				 <a href="javascript:history.go(-1)"><span class="icon1 icon_com"></span></a>
			 </div>
			   {if $title}
			    <div class="title">{$title}</div> 
               {else}
                <div class="title">{$seo_title}</div> 
               {/if}<div class="search sprite_icon">
			    <!-- <span class="icon2 icon_com">-->
			 </div>
		 </div>
	 </div>  
  <include file="Mobile:nav"/>           
 <div class="catering-padding">
		 <div class="info">
			 <div class="caption" style="font-size:16px;">{$title}</div>
			 <p>发布时间：<em>{$createtime|toDate=###,'m-d'}</em>&nbsp;&nbsp;&nbsp;&nbsp;<span class="icon1"></span><strong>19693</strong></p>
		 </div>

		 <div class="mes" style="  margin:10px auto; font-size:14px;">
		    {$content}
		 </div>

		
	 </div>
 {if $title}    
 <form name="myform" id="myform" action="{:URL('User-Index/comment_post')}" method="post" onSubmit="return logina();">
                    <input type="hidden" name="conid" value="{$id}"/> 
                    <input type="hidden" name="contype" value="News"/>
                    <input type="hidden"  name="moduleid" value="{$moduleid}" />
                    <input type="hidden"  name="catid" value="{$catid}" />
                    <input type="hidden"  name="title" value="{$title}" /
                    <input type="hidden"  name="lang" value="{$langid}" />
                    <input type="hidden"  name="url" value="<?php echo $_SERVER['REQUEST_URI'];?>" /> 
	     <div class="padding_section clear border_bottom">
			 <div class="discuss clear">
				 <div class="pic">
					 <img src="../Public/images/effect_pic4.jpg" alt="" />
				 </div>
				 <textarea name="" id="" cols="30" rows="10" placeholder="添加评论~~" class="discuss_box"></textarea>
                 
			 </div>
              <input type="submit" value="添加评论" class="add_discuss" style="font-family:微软雅黑"  />
			
		 </div>
 </form> 		 

         <ul class="comment_list">
   <?php 
         $field='jg_comment.id,jg_comment.content,jg_comment.createtime,jg_user.id as userid,jg_user.avatar,jg_user.username';
         $where='jg_Comment.`conid`='.$id.' and contype="News"';
         $reluts=M('Comment')->field($field)->where($where)->join('jg_user ON jg_comment.userid = jg_user.id')->limit('50')->select();
          foreach($reluts as $key=>$val){
    ?>
             <li class="clear">
                 <div class="pic">
                      <a href="index.php?g=Mobile&m=User&a=index&id={$val['userid']}"><img src="{$val['avatar']}" alt="" /></a> 
                 </div>
                 <div class="info">
                     <strong><a href="index.php?g=Mobile&m=User&a=index&id={$val['userid']}">{$val['username']}</a></strong>
                     <span>{$val.createtime|toDate=###,'m-d H:i:s'}</span>
                     <em>说：</em>
                     <p class="mes">{$val['content']}</p>
                 </div>
             </li>
   <?php }?>       
         </ul>
{/if}
		 <div class="btn_center">
			 <!--<a href="javascript:;" class="btn">更多评论</a>-->
		 </div>

		 <div class="hot_diary">
			 <h2>热门资讯</h2>

			 <div class="info">
				 <div class="P_mod_effect_catering">
					 <ul class="list clear">
                          <YP:list  name="News" order="id desc" where="pos_hot=1"  limit="4"    id="r">
                             <li class="part {if $key%2!=0}no_margin{/if}">
                                 <div class="padding">
                                     <div class="pic">
                                         <a href="index.php?g=Mobile&m=News&a=show&id={$r.id}"><img src="{$r['pic']}" height="104" alt="" /></a>
                                     </div>
                                     <div class="info"><a href="index.php?g=Mobile&m=News&a=show&id={$r.id}">{$r['title']|str_cut=###,20}</a>
                                     </div>
                                     <div class="sprite_icon sociality clear">
                                         <span class="icon_com icon11"></span><em>{$r.createtime|toDate=###,'m-d'}</em>
                                         <a href="javascript:;">
                                             <span class="icon_com icon4"></span><i>{$r['hits']}</i>
                                         </a>
                                     </div>
                                 </div>
                             </li>
					       </YP:list>
                     </ul>
		         </div>
			 </div>
		 </div>
     </div>
     
 <script type="text/javascript">
  
window.setTimeout(function(){
     $('.mes img').each(function() {
		 var maxWidth = $('.mes').width(); // 图片最大宽度
		 var ratio = 0;  // 缩放比例
		 var width = $(this).width();    // 图片实际宽度
		 var height = $(this).height();  // 图片实际高度
		
	   
		 // 检查图片是否超宽
		 if(width > maxWidth){
			 ratio = maxWidth / width;   
			 $(this).css("width", maxWidth); // 设定实际显示宽度
			 height = height * ratio;    // 计算等比例缩放后的高度 
			 $(this).css("height", height);  // 设定等比例缩放后的高度
		 }
    });
},1000);
 
 </script>                                                                                                                                                    